home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
TURB_VIS
/
TVG121
/
TVGRAPH.INT
< prev
next >
Wrap
Text File
|
1994-05-27
|
4KB
|
114 lines
(* TVGRAPH.TPU provides all of the basic functions required by your *)
(* Graphics TURBOVISION application *)
const
(* The following constants determine the graphics mode for TVG to work in *)
(* NOTE the restrictions for each resolution *)
smVGA320x200x16 = $00D; (* Not available in BGI *)
smVGA640x200x16 = $00E;
smVGA640x350x16 = $010;
smVGA640x480x16 = $012;
smVesa800x600x16 = $102; (* No mouse cursor - FUTURE VERSIONS *)
smVesa1024x768x16 = $104; (* Not available yet *)
smVesa1280x1024x16 = $106; (* Not available yet *)
smUseBGIInterface = $200; (* Use the BGI interface to init graphics *)
smUseTVGInterface = $000; (* Use the BIOS/VESA to init graphics *)
(* Each graphics view has a co-ordinate system of 10000 by 7500 *)
(* These are the constants for that co-ordinate system *)
GraphXMax = 10000;
GraphYMax = 7500;
cmGraphDraw = 191; (* Command constant for graphic draw of view *)
cmGraphProd = 192; (* Prod command - allowing moving/continuous *)
(* graphics images *)
cmGraphClear = 193; (* Clear graphics view *)
type
(* graphics object - base level *)
pgObject = ^gObject;
gObject = object(TObject)
Color:byte;
constructor Init(C:byte);
procedure GraphDraw(R:TRect); virtual;
procedure GraphProd; virtual;
procedure ChangeColor(C:Byte);
end;
(* graphics line object *)
pgLine = ^gLine;
gLine = object(gObject)
Xa,Ya,Xb,Yb:integer;
constructor Init(X1,Y1,X2,Y2:integer;C:byte);
procedure GraphDraw(R:TRect); virtual;
procedure ChangeEnds(X1,Y1,X2,Y2:integer);
procedure ChangeEndsCopy(S:gLine);
procedure DeltaEnds(X1,Y1,X2,Y2:integer);
end;
(* graphics box object *)
pgBox = ^gBox;
gBox = object(gLine)
procedure GraphDraw(R:TRect); virtual;
end;
(* Use a gApp in your program just as you would use a TApplication object *)
pgApp = ^gApp;
gApp = object(TProgram)
GrMode:word; (* Graphics mode of application *)
Prodable:boolean; (* Prodable is TRUE for continuous updating *)
constructor Init(Mode:word);
destructor Done; virtual;
procedure SetScreenMode(Mode: Word);
procedure Idle; virtual;
{$IFDEF Ver70}
procedure Cascade;
procedure DosShell;
procedure GetTileRect(var R: TRect); virtual;
procedure HandleEvent(var Event: TEvent); virtual;
procedure Tile;
procedure WriteShellMsg; virtual;
{$ENDIF}
end;
(* Use a gView in your program where you want graphics functions within a view*)
pgView = ^gView;
gView = object(TView)
GraphWindowId:byte; (* The graphics window Id for this view *)
DisplayList:TCollection; (* List of gObjects
constructor Init(Var Bounds:Trect);
destructor Done;virtual;
procedure GraphProd;
procedure GraphDraw;
procedure GraphClear;
procedure Draw; virtual;
procedure HandleEvent(var Event:TEvent); virtual;
procedure ChangeBounds(var Bounds: TRect); virtual;
procedure Insert(P:pgObject);
procedure Delete(P:pgObject);
end;
(* Use a gWindow for any Window that contains graphics views *)
pgWindow = ^gWindow;
gWindow = object(TWindow)
constructor Init(var Bounds: TRect; ATitle: TTitleStr; ANumber: Integer);
procedure ChangeBounds(var Bounds: TRect); virtual;
procedure HandleEvent(var Event:TEvent);virtual;
procedure GraphDraw;
procedure GraphClear;
procedure GraphProd;
end;
procedure DrawLine(X1,Y1,X2,Y2:integer;Color:word);
(* Draw a line from X1,Y1 to X2,Y2 in screen co-ordinates with clipping *)
(* and graphics window ID protect, with mouse protection using color *)
procedure GlobalToPhysical(R:TRect;X0,Y0:integer;var X,Y:integer);
(* Translate 10000x7500 co-ordinate in R to physical co-ordinate *)